﻿using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.IO;

namespace OpenLS.Spreadsheet.Formats.Biff.Records
{
    internal class FtRboData
    {
        private bool fFirstBtn;
        private ushort idRadNext;

        public void Read(BinaryReader reader)
        {
            ushort ft = reader.ReadUInt16();
            Contract.Assert(ft == 0x0011);
            ushort cb = reader.ReadUInt16();
            Contract.Assert(cb == 0x0004);
            idRadNext = reader.ReadUInt16();
            fFirstBtn = reader.ReadUInt16() != 0;
        }

        public void Write(BinaryWriter writer)
        {
            const ushort ft = 0x0011;
            writer.Write(ft);

            const ushort cb = 0x0004;
            writer.Write(cb);
            writer.Write(idRadNext);
            writer.Write((ushort)(fFirstBtn ? 1 : 0));
        }
    }
}